import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: '登录账号',
    key: 'userName',
  },
  {
    title: '登录设备',
    key: 'equipment',
  },
  {
    title: 'IP地址',
    key: 'remoteIp',
  },
  {
    title: '登录时间',
    key: 'loginTime',
  },
  {
    title: '状态',
    key: 'loginStatus',
    render(row) {
      return h(
        NTag,
        {
          type: row.loginStatus === '成功' ? 'success' : 'error',
        },
        {
          default: () => (row.loginStatus === '成功' ? '成功' : '失败'),
        }
      );
    },
  },
];
